/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 28956
 * Date: 2024-07-20
 * Time: 20:56
 */
public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        System.out.print("递归求前序遍历：");
        binaryTree.preOrder(root);
        System.out.println();

        System.out.print("非递归前序遍历：");
        binaryTree.preOrderNor(root);
        System.out.println();

        System.out.print("递归求中序遍历：");
        binaryTree.inOrder(root);
        System.out.println();

        System.out.print("非递归中序遍历：");
        binaryTree.inOrderNor(root);
        System.out.println();

        System.out.print("递归求后序遍历：");
        binaryTree.postOrder(root);
        System.out.println();

        System.out.print("非递归中序遍历：");
        binaryTree.postOderNor(root);
        System.out.println();

        System.out.println("节点个数："+binaryTree.size1(root));
        System.out.println("节点个数："+binaryTree.size2(root));

        System.out.println("叶子节点个数："+binaryTree.getLeafNodeCount1(root));
        System.out.println("叶子节点个数："+binaryTree.getLeafNodeCount2(root));

        System.out.println("第k层节点个数："+binaryTree.getKLevelNodeCount(root, 2));

        System.out.println("树的高度："+binaryTree.getHeight(root));

        System.out.println("查找E："+binaryTree.find(root,'E'));

        System.out.print("层序遍历：");
        binaryTree.levelOrder(root);
        System.out.println();

        System.out.println(binaryTree.isCompleteTree(root));

    }

}
